﻿<Window x:Class="TfsBugger.Forms.CheckInBuggerWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:bg="clr-namespace:TfsBugger.Buggers"
    Title="Check-In Bugger" 
    Height="329" 
    Width="754" 
    Loaded="OnWindowLoaded" 
    Closing="OnWindowClosing">
	<Window.Resources>
		<ResourceDictionary>
			<ResourceDictionary.MergedDictionaries>
				<ResourceDictionary Source="../DefaultStyles.xaml" />
			</ResourceDictionary.MergedDictionaries>
			<bg:CheckInBugger 
				x:Key="CheckInBugger" 
				WaitInterval="5" 
				PollingStatusUpdated="OnPollingStatusUpdated" 
				TargetUpdated="OnCheckInTargetUpdated" 
				WorkFinished="OnBuggerWorkFinished" />
		</ResourceDictionary>		
	</Window.Resources>
	<Grid>
		<Grid.RowDefinitions>
			<RowDefinition />
			<RowDefinition Height="35" />
		</Grid.RowDefinitions>
		<DockPanel LastChildFill="True" Grid.Row="0">
			<!--<ToolBarPanel DockPanel.Dock="Top">-->
			<ToolBar DockPanel.Dock="Top">
				<ToolBar.Items>
					<TextBlock Text="Project:" Margin="5"></TextBlock>
					<ComboBox Name="cboProjects" Width="200" SelectionChanged="OnSelectedProjChanged"></ComboBox>
					<Slider Name="sldInterval" Minimum="1" Maximum="60" Interval="10" ></Slider>
					<Button 
						Name="btnStart" 
						IsEnabled="false" 
						Click="OnStartButtonClick">
						<TextBlock Text="Start" />
					</Button>
					<Separator />
					<Button 
						Name="btnStop" 
						IsEnabled="false" 
						Click="OnStopButtonClick">
						<TextBlock Text="Stop" />
					</Button>
					<Rectangle 
						Name="rectSpinner" 
						Visibility="Hidden" 
						Width="2" 
						Height="20" 
						Stroke="Gray" 
						Fill="Blue" 
						Margin="30 0 0 0">
						<Rectangle.RenderTransform>
							<RotateTransform 
								Angle="1" 
								CenterX="1" 
								CenterY="10">
							</RotateTransform>
						</Rectangle.RenderTransform>
						<Rectangle.Resources>
							<Storyboard x:Key="ProgressAnimation" RepeatBehavior="Forever">
								<DoubleAnimation 
									Name="ProgressAnimation" 
									Storyboard.TargetName="rectSpinner" 
									Storyboard.TargetProperty="RenderTransform.Angle"
									From="0" 
									To="360" 
									Duration="0:0:1">
								</DoubleAnimation>
							</Storyboard>
						</Rectangle.Resources>
					</Rectangle>
					<TextBlock 
						Name="lblBugStatus"
						Text="Bugging server for check-ins..." 
						Visibility="Hidden" 
						VerticalAlignment="Center" 
						Margin="10 0 0 0" />
				</ToolBar.Items>
			</ToolBar>
			<!--</ToolBarPanel>-->
			<ListView Name="lstCheckIns" DockPanel.Dock="Top">
				<ListView.Background>
					<LinearGradientBrush>
						<LinearGradientBrush.GradientStops>
							<GradientStop Offset="0" Color="WhiteSmoke"/>
							<GradientStop Offset="1" Color="White"/>
						</LinearGradientBrush.GradientStops>
					</LinearGradientBrush>
				</ListView.Background>
				<ListView.View>
					<GridView>
						<GridView.Columns>
							<GridViewColumn Header="Changeset ID">
								<GridViewColumn.CellTemplate>
									<DataTemplate>
										<TextBlock Text="{Binding Path=ChangesetId}" />
							</DataTemplate>
								</GridViewColumn.CellTemplate>
							</GridViewColumn>
							<GridViewColumn Header="Committer">
								<GridViewColumn.CellTemplate>
									<DataTemplate>
										<TextBlock Text="{Binding Path=Committer}" />
							</DataTemplate>
								</GridViewColumn.CellTemplate>
							</GridViewColumn>
							<GridViewColumn Header="Comment">
								<GridViewColumn.CellTemplate>
									<DataTemplate>
										<TextBlock Text="{Binding Path=Comment}" />
							</DataTemplate>
								</GridViewColumn.CellTemplate>
							</GridViewColumn>
						</GridView.Columns>
					</GridView>
				</ListView.View>
			</ListView>
		</DockPanel>
		<DockPanel Grid.Row="1">
			<DockPanel.Background>
				<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
					<LinearGradientBrush.GradientStops>
						<GradientStop Offset="0" Color="LightGray" />
						<GradientStop Offset="0.2" Color="WhiteSmoke" />
						<!--<GradientStop Offset="0.4" Color="WhiteSmoke" />-->
						<GradientStop Offset="1" Color="White"/>
					</LinearGradientBrush.GradientStops>
				</LinearGradientBrush>
			</DockPanel.Background>
			<Button HorizontalAlignment="Right" DockPanel.Dock="Right" Style="{StaticResource ButtonDefault}" Click="OnCloseButtonClick">
				<TextBlock Text="Close" />
			</Button>
		</DockPanel>
	</Grid>
	
	
</Window>